﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/SiteManage.Master" AutoEventWireup="true" CodeBehind="Sach.aspx.cs" Inherits="NXBSaiGon.Admin.Sach" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NXBSaiGonConnectionString1 %>" 
        DeleteCommand="DELETE FROM [Sach] WHERE [MaSach] = @MaSach" 
        InsertCommand="INSERT INTO [Sach] ([MaLoaiSach], [TenSach], [NgayXuatBan], [MoTa], [SoLuong], [DonGia], [ImageURL], [ChieuCao], [ChieuRong], [BeDay], [KhoiLuong], [NgayNhapKho]) VALUES (@MaLoaiSach, @TenSach, @NgayXuatBan, @MoTa, @SoLuong, @DonGia, @ImageURL, @ChieuCao, @ChieuRong, @BeDay, @KhoiLuong, @NgayNhapKho)" 
        ProviderName="<%$ ConnectionStrings:NXBSaiGonConnectionString1.ProviderName %>" 
        SelectCommand="SELECT [MaSach], [MaLoaiSach], [TenSach], [NgayXuatBan], [MoTa], [SoLuong], [DonGia], [ImageURL], [ChieuCao], [ChieuRong], [BeDay], [KhoiLuong], [NgayNhapKho] FROM [Sach] WHERE MaSach = @MaSach AND MaLoaiSach = @MaLoaiSach" 
        UpdateCommand="UPDATE [Sach] SET [MaLoaiSach] = @MaLoaiSach, [TenSach] = @TenSach, [NgayXuatBan] = @NgayXuatBan, [MoTa] = @MoTa, [SoLuong] = @SoLuong, [DonGia] = @DonGia, [ImageURL] = @ImageURL, [ChieuCao] = @ChieuCao, [ChieuRong] = @ChieuRong, [BeDay] = @BeDay, [KhoiLuong] = @KhoiLuong, [NgayNhapKho] = @NgayNhapKho WHERE [MaSach] = @MaSach">
        <SelectParameters>
            <asp:QueryStringParameter QueryStringField="MaSach" Name="MaSach" Type="Int32" />
            <asp:QueryStringParameter QueryStringField="MaLoaiSach" Name="MaLoaiSach" Type="Int32" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="MaSach" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="MaLoaiSach" Type="Int32" />
            <asp:Parameter Name="TenSach" Type="String" />
            <asp:Parameter Name="NgayXuatBan" Type="DateTime" />
            <asp:Parameter Name="MoTa" Type="String" />
            <asp:Parameter Name="SoLuong" Type="Int32" />
            <asp:Parameter Name="DonGia" Type="Decimal" />
            <asp:Parameter Name="ImageURL" Type="String" />
            <asp:Parameter Name="ChieuCao" Type="Decimal" />
            <asp:Parameter Name="ChieuRong" Type="Decimal" />
            <asp:Parameter Name="BeDay" Type="Decimal" />
            <asp:Parameter Name="KhoiLuong" Type="Decimal" />
            <asp:Parameter Name="NgayNhapKho" Type="DateTime" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="MaLoaiSach" Type="Int32" />
            <asp:Parameter Name="TenSach" Type="String" />
            <asp:Parameter Name="NgayXuatBan" Type="DateTime" />
            <asp:Parameter Name="MoTa" Type="String" />
            <asp:Parameter Name="SoLuong" Type="Int32" />
            <asp:Parameter Name="DonGia" Type="Decimal" />
            <asp:Parameter Name="ImageURL" Type="String" />
            <asp:Parameter Name="ChieuCao" Type="Decimal" />
            <asp:Parameter Name="ChieuRong" Type="Decimal" />
            <asp:Parameter Name="BeDay" Type="Decimal" />
            <asp:Parameter Name="KhoiLuong" Type="Decimal" />
            <asp:Parameter Name="NgayNhapKho" Type="DateTime" />
            <asp:Parameter Name="MaSach" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>

    <div style="text-align:center">
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        CellPadding="4" DataKeyNames="MaSach" DataSourceID="SqlDataSource1" 
        ForeColor="#333333" GridLines="None" Height="50px" Width="336px">
        <AlternatingRowStyle BackColor="White" />
        <CommandRowStyle BackColor="#C5BBAF" Font-Bold="True" />
        <EditRowStyle BackColor="#7C6F57" />
        <FieldHeaderStyle BackColor="#D0D0D0" Font-Bold="True" />
        <Fields>
            <asp:BoundField DataField="MaSach" HeaderText="MaSach" InsertVisible="False" 
                ReadOnly="True" SortExpression="MaSach" />
            <asp:BoundField DataField="MaLoaiSach" HeaderText="MaLoaiSach" 
                SortExpression="MaLoaiSach" />
            <asp:BoundField DataField="TenSach" HeaderText="TenSach" 
                SortExpression="TenSach" />
            <asp:BoundField DataField="NgayXuatBan" HeaderText="NgayXuatBan" 
                SortExpression="NgayXuatBan" />
            <asp:BoundField DataField="MoTa" HeaderText="MoTa" SortExpression="MoTa" />
            <asp:BoundField DataField="SoLuong" HeaderText="SoLuong" 
                SortExpression="SoLuong" />
            <asp:BoundField DataField="DonGia" HeaderText="DonGia" 
                SortExpression="DonGia" />
            <asp:BoundField DataField="ImageURL" HeaderText="ImageURL" 
                SortExpression="ImageURL" />
            <asp:BoundField DataField="ChieuCao" HeaderText="ChieuCao" 
                SortExpression="ChieuCao" />
            <asp:BoundField DataField="ChieuRong" HeaderText="ChieuRong" 
                SortExpression="ChieuRong" />
            <asp:BoundField DataField="BeDay" HeaderText="BeDay" SortExpression="BeDay" />
            <asp:BoundField DataField="KhoiLuong" HeaderText="KhoiLuong" 
                SortExpression="KhoiLuong" />
            <asp:BoundField DataField="NgayNhapKho" HeaderText="NgayNhapKho" 
                SortExpression="NgayNhapKho" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                ShowInsertButton="True" />
        </Fields>
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
    </asp:DetailsView>
    </div>
</asp:Content>
